-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MoE][PyTorch] Add mask-based MoE permutation #1373
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hxbai
changed the title
[MoE][Common/PyTorch] Add mask-based MoE permutation
[MoE][PyTorch] Add mask-based MoE permutation
Dec 13, 2024
yaox12
reviewed
Dec 13, 2024
Signed-off-by: Hongxiao Bai <[email protected]>
for more information, see https://pre-commit.ci Signed-off-by: Hongxiao Bai <[email protected]>
Signed-off-by: Hongxiao Bai <[email protected]>
Signed-off-by: Hongxiao Bai <[email protected]>
hxbai
force-pushed
the
permute_fusion
branch
from
December 13, 2024 06:05
6160104
to
ca94d72
Compare
timmoon10
reviewed
Jan 8, 2025
phu0ngng
reviewed
Jan 10, 2025
Signed-off-by: Hongxiao Bai <[email protected]>
Signed-off-by: Hongxiao Bai <[email protected]>
Signed-off-by: Hongxiao Bai <[email protected]>
Signed-off-by: Hongxiao Bai <[email protected]>
Hi @timmoon10 @phu0ngng, could you help take another look at this? We intend to incorporate this optimization into mcore v0.11 (6th Feb). Thanks a lot! |
phu0ngng
approved these changes
Jan 21, 2025
/te-ci pytorch |
timmoon10
approved these changes
Jan 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. My suggestions are stylistic.
Signed-off-by: Hongxiao Bai <[email protected]>
youngeunkwon0405
pushed a commit
to youngeunkwon0405/TransformerEngine
that referenced
this pull request
Jan 27, 2025
* add mask-based moe permutation * change moe_chunk_permute to moe_sort_chunks_by_indices * fix __all__ in pytorch/permutation.py * fix func/var names and typos; update tols in UT --------- Signed-off-by: Hongxiao Bai <[email protected]> Co-authored-by: Phuong Nguyen <[email protected]> Co-authored-by: Tim Moon <[email protected]> Signed-off-by: Youngeun Kwon <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add mask-based token permutation and local chunk permutation fused kernels. These kernels are implemented with OpenAI Triton.
Related commit in Megatron-LM NVIDIA/Megatron-LM@ac0474d
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
te.pytorch.permutation.moe_permute
andte.pytorch.permutation.moe_unpermute
te.pytorch.permutation.moe_sort_chunks_by_indices
Checklist: